<template>
  <div class="hamburger-container" @click="toggleClick">
    <el-icon id="guide-hamburger">
      <Fold v-show="sidebarOpened" />
      <Expand v-show="!sidebarOpened" />
    </el-icon>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useStore } from 'vuex'
import { Fold, Expand } from '@element-plus/icons-vue'

const store = useStore()
const toggleClick = () => {
  store.commit('app/triggerSidebarOpened')
}

const sidebarOpened = computed(() => store.getters.sidebarOpened)
</script>

<style lang="scss" scoped>
.hamburger-container {
  padding: 0 16px;
  .hamburger {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
  }
}
</style>
